package serializables;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Date;

public class ServerStatus implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 775234465622184877L;
	
	
	//-------------------ATTRIBUTEN-----------------------------------------
	private String name;
	private Date lastUpdated;
	private String randomText;
	private long versionId;
	
	
	//------------------CONSTRUCTORS------------------------------------
	public ServerStatus() {
		super();
		versionId = 1;
	}
	
	
	//-----------------GETTERS EN SETTERS-------------------------------------
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Date getLastUpdated() {
		return lastUpdated;
	}
	public void setLastUpdated(Date lastUpdated) {
		this.lastUpdated = lastUpdated;
	}
	public String getRandomText() {
		return randomText;
	}
	public void setRandomText(String randomText) {
		this.randomText = randomText;
	}
	public void setVersionId(long versionId){
		this.versionId = versionId;
	}

	public long getVersionId() {
		return this.versionId;
	}
	
	//----------------METHODES------------------------------------------------
	
	private void writeObject(ObjectOutputStream out) throws IOException{
		out.defaultWriteObject();
	}
	
	private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException{
		in.defaultReadObject();
	}


	public void setNewVersionId() {
		versionId++;
	}



}
